/*
	File:	video/Font.hpp
	Date:	2013-06-01
	Author:	Asteroth
*/


#ifndef __ZEN_FONT_HPP__
#define __ZEN_FONT_HPP__

#include <string>
#include <glm/glm.hpp>
#include <ptr.hpp>

#include "Texture.hpp"

namespace zen {

	namespace video {


		class Font {

		public:

			Font();
			Font(const PTexture &texture, int textureSize, const arr(glm::ivec3) &steps, const arr(glm::ivec4) &rects, int glyphCount);
			~Font();

			PTexture getTexture() const { return texture; }

			void drawText(const std::string &text, float x, float y, float depth = 0.0f) const;

			int getTextWidth(const std::string &text) const;

			
		private:

			PTexture texture;			// A texture which contains the font's characters
			float pixelSize;			// Size of a pixel on the texture
			arr(glm::ivec3) steps;		// Glyphs cursor advance (advanceX, paddingLeft, paddingTop)
			arr(glm::ivec4) rects;		// Glyphs locations on the texture (x, y, width, height)
			int glyphCount;				// Glyphs count

		};


		typedef ptr(Font) PFont;


	} // namespace video

} // namespace zen

#endif // __ZEN_FONT_HPP__
